<h1>Assign Enquary to App user</h1>

<div class="form">

    <?php
    $form = $this->beginWidget('GxActiveForm', array(
        'id' => 'assign-form',
            ));
    ?>
    <?php
    foreach ($user as $key => $obj) {
        ?>



    <?php
    $checked = '';
     if (!empty($selected)) {
                foreach ($selected as $select) {
                   
                    if ($obj->id == $select) {
                        $checked = 'checked="checked"';
                        break;
                    } else {
                        $checked = '';
                    }
                }
            }
    echo '<div><input  type="checkbox" name="AppUsers[]"  id="AppUsers' . $obj->id . '" value="' . $obj->id . '"  ' . $checked . '>
        <span class="appuser_name">' . $obj->username . '</span></div>';
}
?>


    <div class="row">
        <div class="rowLabel">
        </div>
        <div class="rowControl"> <?php
    echo GxHtml::submitButton(Yii::t('app', 'Save'),array('name'=>'appuserSave','class'=>'btn btn-primary '));
    $this->endWidget();
?>
        </div></div>
</div>
<!-- form -->
